﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Create.aspx.cs" Inherits="H2.NET.Web.Management.Config.Create" %>
<div class="page">
    <div class="pageContent">
        <form method="post" action="<%=H2.NET.Common.AksRequest.GetVirtualUrl()%>?action=save" class="pageForm required-validate" onsubmit="return validateCallback(this, initMenu);">
            <input type="hidden" runat="server" id="hd_parentId" name="hd_parentId"/>
            <input type="hidden" runat="server" id="rel" name="rel"/>
            <div class="pageFormContent" layouth="50">
                <table class="formTable">
                    <tr>
                        <th width="20%">名字:</th>
                        <td width="80%">
                            <input name="Name" class="required" type="text" style="width:80%" />
                        </td>
                    </tr>
                    <tr>
                        <th width="20%">内容:</th>
                        <td width="80%">
                            <input name="Value" class="required" type="text" style="width:80%" />
                        </td>
                    </tr>
                    <tr>
                        <th width="20%">排序</th>
                        <td width="80%">
                            <input name="Order_xh" class="required" type="text" size="18" />
                        </td>
                    </tr>
                    <tr>
                        <th width="20%">Code</th>
                        <td width="80%">
                            <input name="Code" class="required" type="text" size="18" />
                        </td>
                    </tr>
                    <tr>
                        <th width="20%">Level</th>
                        <td width="80%">
                            <input name="l_level" id="l_level" readonly runat="server" type="text" size="18" />
                        </td>
                    </tr>
                </table>
            </div>
            
            <div class="formBar">
        <ul>
            <li>
                <div class="buttonActive">
                    <div class="buttonContent">
                        <button type="submit">保存数据</button></div>
                </div>
            </li>
            <li>
                <div class="button">
                    <div class="buttonContent">
                        <button type="button" class="close">关闭窗口</button></div>
                </div>
            </li>
        </ul>
    </div>
        </form>
        </div>
</div>

<script type="text/javascript">
    function initMenu(json) {

        var pId = $("#hd_parentId").val();

        if (pId == "") {
            $.ajax({
                type: 'POST',
                url: "Management/Config/Index.aspx?action=menu",
                dataType: "html",
                cache: false,
                success: function (html) {
                    $(".folder44").parent().parent().next().children().children().not(":first").remove();
                    $(".folder44").parent().parent().next().children().append(html);
                    $("a[rel^=ConfigIndex_]").each(function () {
                        $(this).click(function (event) {
                            var $this = $(this);
                            var title = $this.attr("title") || $this.text();
                            var tabid = $this.attr("rel") || "_blank";
                            var fresh = eval($this.attr("fresh") || "true");
                            var external = eval($this.attr("external") || "false");
                            var url = unescape($this.attr("href")).replaceTmById($(event.target).parents(".unitBox:first"));
                            DWZ.debug(url);
                            if (!url.isFinishedTm()) {
                                alertMsg.error($this.attr("warn") || DWZ.msg("alertSelectMsg"));
                                return false;
                            }
                            navTab.openTab(tabid, url, { title: title, fresh: fresh, external: external });

                            event.preventDefault();
                        });

                    });
                    dialogAjaxDone(json);
                },
                error: DWZ.ajaxError
            });
        } else {
            dialogAjaxDone(json);
        }
    }
</script>